using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;

namespace Sigecov.Models.Mapping
{
    public class CategoriaMap : EntityTypeConfiguration<Categoria>
    {
        public CategoriaMap()
        {
            // Primary Key
            this.HasKey(t => t.catId);

            // Properties
            this.Property(t => t.catNome)
                .IsRequired()
                .HasMaxLength(30);

            // Table & Column Mappings
            this.ToTable("Categorias");
            this.Property(t => t.catId).HasColumnName("catId");
            this.Property(t => t.catNome).HasColumnName("catNome");
        }
    }
}
